package com.open.core.store

import android.content.ContentProvider
import android.content.ContentValues
import android.database.Cursor
import android.net.Uri
import android.util.Log
import com.tencent.mmkv.MMKV

/**************************************************************
 *
 *
 * MMKV存储不需要监听状态的值
 *
 * @author :guangjing.feng.o
 * @createTime: 2021/6/3.
 * @modifyTime:
 * @modifyAuthor:
 * @description:
 *
 ************************************************************/
class MMKVContentProvider : ContentProvider() {

    override fun onCreate(): Boolean {
        var rootPath = MMKV.initialize(context)
        Log.d("MMKVContentProvider", "initialize rootPath == ${rootPath}")
        SharePreferencesHelper.getInstance(context!!)
        return true
    }

    override fun insert(uri: Uri, values: ContentValues?): Uri? {
        return null
    }

    override fun query(
        uri: Uri,
        projection: Array<out String>?,
        selection: String?,
        selectionArgs: Array<out String>?,
        sortOrder: String?
    ): Cursor? {
        return null
    }


    override fun update(
        uri: Uri,
        values: ContentValues?,
        selection: String?,
        selectionArgs: Array<out String>?
    ): Int {
        return 0
    }

    override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int {
        return 0
    }

    override fun getType(uri: Uri): String? {
        return null
    }
}